package com.sczmgk.hotline_pzh.utils;

import android.view.View;

import com.sczmgk.hotline_pzh.R;
import com.sczmgk.hotline_pzh.base.BaseActivity;
import com.sczmgk.hotline_pzh.constants.Constants;
import com.sczmgk.hotline_pzh.sp.CacheUtils;

/**
 * Created by Administrator on 2016/2/19.
 */
public class OnLineUtils {
    /**
     * 1.设置title 右边按钮显示 “人工下单”  2.点击后跳转到热线电话
     * @param activity
     */
    public static void onLine(final BaseActivity activity){
        activity.setRightBtnVisibility(View.VISIBLE);
        activity.setRightBtnText(R.string.title_right_on_line);
        activity.setRightBtnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                CommonUtils.callPhone(activity, CacheUtils.getStringData(activity, Constants.HOTLINE_KEY, 0 + ""));
            }
        });
    }
}
